<?php

class SpravaKlubu extends Module{

	public function __construct(){
		$this->author = "Tomáš Voslař";
		$this->name = "Správa klubu";
		$this->presenter = "SpravaKlubu";
		$this->version = "1.0";
		$this->params = "";
	}

	public function getSql(){
			
		dibi::query("CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "klub_kategorie` (
  				`id_kategorie` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  				`nazev` varchar(255) NOT NULL,
  				`nazev_seo` varchar(255) NOT NULL,
  				`popis` text NOT NULL,
  				`vek_od` tinyint(1) NULL,
  				`vek_do` tinyint(1) NULL,
  				PRIMARY KEY (`id_kategorie`)
				) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
				");
		
		dibi::query("CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "klub_sezony` (
  				`id_sezony` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  				`rok_od` mediumint(4) NOT NULL,
  				`rok_do` mediumint(4) NOT NULL,
  				`aktivni` tinyint(1) NOT NULL,
  				PRIMARY KEY (`id_sezony`)
				) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
				");
		
		dibi::query("CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "klub_tymy` (
  				`id_tym` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  				`nazev` varchar(255) NOT NULL,
  				`nazev_seo` varchar(255) NOT NULL,
  				`kontakt` text NOT NULL,
  				`info` text NOT NULL,
  				`klub` tinyint(1) NOT NULL,
  				PRIMARY KEY (`id_tym`)
				) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
				");
		
		dibi::query("CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "klub_hraci` (
  				`id_hrac` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  				`jmeno` varchar(255) NOT NULL,
  				`prijmeni` varchar(255) NOT NULL,
  				`vyska` tinyint(4) unsigned NOT NULL,
  				`vaha` tinyint(4) unsigned NOT NULL,
  				`posty` varchar(255) NOT NULL,
  				PRIMARY KEY (`id_hrac`)
				) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
				");
			
	}

}

?>